#! /bin/bash
if [ ! -d "logs" ];then
  `mkdir logs`
fi

if [ $# -eq 0 ];then
   echo '未检测到端口传入，不会启动服务'
fi

for port in $@;do
  echo '启动'$port'端口服务'
  nohup ./gradlew runServer -Pport=$port> logs/outputServer 2>&1 & echo $!>logs/pid$port
done
